//
//  AddCourseTableViewCell.swift
//  约健
//
//  Created by tyh on 2017/9/14.
//  Copyright © 2017年 tyh. All rights reserved.
//

import UIKit

class AddCourseTableViewCell: UITableViewCell {
    var TittleLabel:UILabel!
    var bjimageView: UIImageView!
    var Addbutton:UIButton!
    var ContentLabel:UILabel!
    let radio:CGFloat = 0.25

    override func awakeFromNib() {
        super.awakeFromNib()
     
        TittleLabel = UILabel()
        TittleLabel.font = UIFont.systemFont(ofSize: 15)
        TittleLabel.textColor = UIColor.gray
        self.contentView.addSubview(TittleLabel)
        
        bjimageView = UIImageView()
        self.contentView.addSubview(bjimageView)
        self.contentView.sendSubview(toBack: bjimageView)
        
        ContentLabel = UILabel()
        ContentLabel.font = UIFont.systemFont(ofSize: 13)
        ContentLabel.textColor = UIColor.white
        self.contentView.addSubview(ContentLabel)
        
        Addbutton = UIButton()
        Addbutton.setTitle("加入课程", for: .normal)
        Addbutton.setTitleColor(UIColor.white, for: .normal)
        Addbutton.backgroundColor = UIColor(displayP3Red: 0, green: 0, blue: 0, alpha: 0)
        Addbutton.layer.borderWidth = 1
        Addbutton.layer.borderColor = UIColor.white.cgColor
        Addbutton.layer.cornerRadius = 10
        self.contentView.addSubview(Addbutton)
    }
    override func layoutSubviews() {
        super.layoutSubviews()
        TittleLabel.frame = CGRect(x: width/36, y: height*radio/40, width: width/5, height: (height*radio*3)/20)
        bjimageView.frame = CGRect(x: width/36, y: height*radio/5, width: (width*17)/18, height: (height*radio*3)/4)
        Addbutton.frame = CGRect(x: width*37/108, y: (height*radio*31)/80, width: (width*17)/54, height: (height*radio*3)/16)
        ContentLabel.frame = CGRect(x: width*19/72, y: (height*radio*23)/40, width: (width*31)/36, height: (height*radio*3)/16)
        
        
        
    }


    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
